package com.konne.nightmare.FastPublicOpinion.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.blankj.utilcode.util.SizeUtils;

/**
 * Create by ws.
 * on Data:2022/2/11  Time:下午 6:13.
 * description: ** .
 */
public class PrepareLessonsView extends LinearLayout {
    public PrepareLessonsView(@NonNull Context context) {
        this(context, null);
    }

    public PrepareLessonsView(@NonNull Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public PrepareLessonsView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setOrientation(VERTICAL);
        addView(getItem("备课需要",false));
        addView(getItem("我的备课区",true));
    }

    private QJItemTitleView getItem(String txt, boolean isLast) {
        QJItemTitleView titleView = new QJItemTitleView(getContext());
        titleView.setTitle(txt);
        titleView.setShowLine(!isLast);
        titleView.setStyle(QJItemTitleView.Style.right);
        LayoutParams params=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, SizeUtils.dp2px(60));
        params.leftMargin=SizeUtils.dp2px(15);
        params.rightMargin=SizeUtils.dp2px(15);
        titleView.setLayoutParams(params);
        return titleView;
    }
}
